<template>
	<div class="lists-nav-container">
    <div class="lists-nav" v-if="navData.dhs_type==1">
      <section :class="navData.curType==1?'cur':''" @click="clickListsNav(1)">全部订单<i></i></section>
      <section :class="navData.curType==2?'cur':''" @click="clickListsNav(2)">{{navData.ftitle_pending_pay}}<i></i></section>
      <section :class="navData.curType==6?'cur':''" @click="clickListsNav(6)">待确认<i></i></section>
      <section :class="navData.curType==3?'cur':''" @click="clickListsNav(3)">已确认<i></i></section>
    </div>
    <div class="lists-nav" v-else>
      <!--  1全部 、2 待付款订单、3已确认 、4退换货 、5 可以评论订单、6待确认、 7 已完成 -->
      <section :class="navData.curType==1?'cur':''" @click="clickListsNav(1)">{{navData.ftitle_all_orders}}<i></i></section>
      <section :class="navData.curType==2?'cur':''" @click="clickListsNav(2)">{{navData.ftitle_pending_pay}}<i></i></section>
      <section :class="navData.curType==6?'cur':''" @click="clickListsNav(6)">{{navData.ftitle_has_pay}}<i></i></section>
      <section :class="navData.curType==3?'cur':''" @click="clickListsNav(3)">{{navData.ftitle_has_shipped}}<i></i></section>
      <section :class="navData.curType==7?'cur':''" @click="clickListsNav(7)">{{navData.ftitle_has_completed}}<i></i></section>
      <section v-if="navData.is_allow_exchange==1 && navData.is_allow_return==1" :class="navData.curType==4?'cur':''" @click="clickListsNav(4)">{{navData.ftitle_return_goods}}<i></i></section>
      <section v-else-if="navData.is_allow_exchange==1" :class="navData.curType==4?'cur':''" @click="clickListsNav(4)">换货<i></i></section>
      <section v-else-if="navData.is_allow_return==1" :class="navData.curType==4?'cur':''" @click="clickListsNav(4)">退货<i></i></section>
      <section v-else :class="navData.curType==7?'cur':''" @click="clickListsNav(7)">已完成<i></i></section>
    </div>
  </div>
</template>

<script>
import Vue from 'vue'
  export default Vue.extend({
    name: 'index',
    components: {
  
    },
    props: {
      navData: {
        type: Object,
        default: {
          dhs_type: 0,
          is_allow_exchange: 1,
          is_allow_return: 1,
          ftitle_all_orders: '全部',
          ftitle_pending_pay: '待付款',
          ftitle_has_shipped: '已发货',
          ftitle_return_goods: '退换货',
          ftitle_has_pay: '已付款',
          ftitle_has_completed: '已完成',
          curType: 1
        }
      }
    },
    data() {
      return {
      }
    },
    methods: {
      clickListsNav(type) {
        if (type != this.navData.curType) {
          this.$emit('changeOrderType', type)
          this.navData.curType = type
        }
      }
    },
    created() {
    }
  })
</script>

<style lang="scss">
@import "src/styles/order/lists";
</style>